import Cookies from "js-cookie";
// 设置cookie
export const SETCOOKIE = (name: string, Cookie: string) => {
  Cookies.set(name, Cookie, {expires: 7});
};

// 获取cookies
export const GETCOOKIE = (name: string) => Cookies.get(name);

// 删除cookies
export const REMOVECOOKIE = (name: string) => {
  Cookies.remove(name);
};

export const SETLOCALSTORE = (name: string, obj: any) => {
  window.localStorage.setItem(name, obj);
};

export const GETLOCALSTORE = (name: string) => window.localStorage.getItem(name);

export const REMOVELOCALSTORE = (name: string) => {
  window.localStorage.removeItem(name);
};

export const SETSESSIONSTORE = (name: string, obj: any) => {
  window.sessionStorage.setItem(name, obj);
};

export const GETSESSIONSTORE = (name: string): null | string => window.sessionStorage.getItem(name);

export const REMOVESESSIONSTORE = (name: string) => {
  window.sessionStorage.removeItem(name);
};
